package day06继承;

public class Circle {
    private double radius = 1;//半径

    //1.初始化半径为静态值，圆柱体积半径拿这个值
    //2.不初始化，半径为默认值，需要使用的时候调用get赋值

//    public Circle(double radius) {
//        this.radius = 1;
//
//    }

    public Circle(){

    }

    public Circle(double radius) {
        this.radius = radius;

    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }
    //求圆的面积
    public double findArea(){

        return 3.14 * (radius * radius);

    }

    @Override
    public String toString() { //帮助快速的找出错误
        return "Circle{" +
                "radius=" + radius +
                '}';
    }
}
